package org.wlw.io;

import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class TestInputStreamReader {
	public static void main(String[] args) {
		BufferedReader br = null;
		PrintWriter out = null;
		try {
			//InputStreamReader就是转换流，将字节流转换为字符流
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new FileWriter("d:/test/23wlw/hello.html"));
			String str = null;
			while((str=br.readLine())!=null) {
				if(str.equalsIgnoreCase("exit")) {
					break;
				}
				out.println(str);
			}
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if(out!=null) out.close();
			try {
				if(br!=null) br.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
